
import Layout from '@/layout'
import Level2 from '@/layout/components/menuLevel2'

const oaRouter = [
  {
    path: '/org',
    component: Layout,
    name: 'org',
    meta: {
      title: '系统管理',
      icon: 'peoples',
      pkey: "sysmanage"
    },
    children: [
      {
        path: 'user',
        name: "user",
        redirect: '/org/user/list',
        component: Level2,
        meta: {
          title: '用户管理',
          pkey: 'userList',
        },
        children: [
          {
            path: 'add',
            name: 'userAdd',
            component: () => import('@/views/oa/user/add'),
            hidden: true,
            meta: {
              title: '员工添加',
              pkey: 'userAdd',
              noCache: true
            }
          },
          {
            path: 'detail/:id',
            name: 'userDetail',
            component: () => import('@/views/oa/user/detail'),
            hidden: true,
            meta: {
              title: '员工详情',
              pkey: 'userDetail',
              noCache: true
            }
          },
          {
            path: 'edit/:id',
            name: 'userEdit',
            component: () => import('@/views/oa/user/edit'),
            hidden: true,
            meta: {
              title: '员工修改',
              pkey: 'userEdit',
              noCache: true
            }
          },
          {
            path: 'list',
            name: 'userList',
            component: () => import('@/views/oa/user/list'),
            hidden: true,
            meta: {
              title: '员工列表',
              pkey: 'userList',
              noCache: true
            }
          }
        ]
      },
      {
        path: 'role',
        name: "role",
        redirect: '/org/role/list',
        component: Level2,
        meta: {
          title: '角色管理',
          pkey: 'roleList'
        },
        children: [
          {
            path: 'add',
            name: 'roleAdd',
            component: () => import('@/views/oa/role/add'),
            hidden: true,
            meta: {
              title: '角色添加',
              pkey: 'roleAdd',
              noCache: true
            }
          },
          {
            path: 'detail/:id',
            name: 'roleDetail',
            component: () => import('@/views/oa/role/detail'),
            hidden: true,
            meta: {
              title: '角色详情',
              pkey: 'roleDetail',
              noCache: true
            }
          },
          {
            path: 'edit/:id',
            name: 'roleEdit',
            component: () => import('@/views/oa/role/edit'),
            hidden: true,
            meta: {
              title: '角色修改',
              pkey: 'roleEdit',
              noCache: true
            }
          },
          {
            path: 'list',
            name: 'roleList',
            component: () => import('@/views/oa/role/list'),
            hidden: true,
            meta: {
              title: '角色列表',
              pkey: 'roleList',
              noCache: true
            }
          }
        ]
      },
      {
        path: 'department',
        name: "department",
        redirect: '/org/department/list',
        component: Level2,
        meta: {
          title: '部门管理',
          pkey: 'departmentList',
        },
        children: [
          {
            path: 'add',
            name: 'departmentAdd',
            component: () => import('@/views/oa/department/add'),
            hidden: true,
            meta: {
              title: '部门添加',
              pkey: 'departmentAdd',
              noCache: true
            }
          },
          {
            path: 'detail/:id',
            name: 'departmentDetail',
            component: () => import('@/views/oa/department/detail'),
            hidden: true,
            meta: {
              title: '部门详情',
              pkey: 'departmentDetail',
              noCache: true
            }
          },
          {
            path: 'edit/:id',
            name: 'departmentEdit',
            component: () => import('@/views/oa/department/edit'),
            hidden: true,
            meta: {
              title: '部门修改',
              pkey: 'departmentEdit',
              noCache: true
            }
          },
          {
            path: 'list',
            name: 'departmentList',
            component: () => import('@/views/oa/department/list'),
            hidden: true,
            meta: {
              title: '部门列表',
              pkey: 'departmentList',
              noCache: true
            }
          }
        ]
      },
      {
        path: 'company',
        name: "company",
        redirect: '/org/company/detail',
        component: Level2,
        meta: {
          title: '公司信息',
          pkey: "companyDetail"
        },
        children: [
          {
            path: 'detail/:id',
            name: 'companyDetail',
            component: () => import('@/views/oa/company/detail'),
            // hidden: true,
            meta: {title: '公司详情', noCache: true, pkey: "companyDetail"}
          },
          {
            path: 'edit/:id',
            name: 'companyEdit',
            component: () => import('@/views/oa/company/edit'),
            hidden: true,
            meta: {title: '公司修改', noCache: true, pkey: "companyEdit"}
          },
          {
            path: 'list',
            name: 'companyList',
            component: () => import('@/views/oa/company/list'),
            meta: {title: '公司列表', noCache: true, pkey: "companyList"}
          }
        ]
      }
    ]
  },
  {
    path: '/resource',
    name: "resource",
    redirect: '/resource/list',
    component: Layout,
    meta: {
      title: '资源管理',
      pkey: 'resourceList'
    },
    children: [
      {
        path: 'add',
        name: 'resourceAdd',
        component: () => import('@/views/oa/resource/add'),
        hidden: true,
        meta: {
          title: '资源添加',
          pkey: 'resourceAdd',
          noCache: true
        }
      },
      {
        path: 'detail/:id',
        name: 'resourceDetail',
        component: () => import('@/views/oa/resource/detail'),
        hidden: true,
        meta: {
          title: '资源详情',
          pkey: 'resourceDetail',
          noCache: true
        }
      },
      {
        path: 'edit/:id',
        name: 'resourceEdit',
        component: () => import('@/views/oa/resource/edit'),
        hidden: true,
        meta: {
          title: '资源修改',
          pkey: 'resourceEdit',
          noCache: true
        }
      },
      {
        path: 'list',
        name: 'resourceList',
        component: () => import('@/views/oa/resource/list'),
        hidden: true,
        meta: {
          title: '资源列表',
          pkey: 'resourceList',
          noCache: true
        }
      }
    ]
  }
]
export default oaRouter
